package com.kanas.webak.rbac.repository;

import java.util.Collection;
import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;

import com.kanas.webak.rbac.domain.AppRole;

public interface RoleRepository extends JpaRepository<AppRole, String>{
	List<AppRole> findByAdminFlagOrderByExportFlagDescSortNumberAsc(boolean admin);
	List<AppRole> findByIdIn(Collection<String> ids);
	List<AppRole> findByUsersId(String userId);
	List<AppRole> findByEnableFlag(boolean enableFlag);
	List<AppRole> findByExportFlagAndEnableFlag(boolean exportFlag,boolean enableFlag);
	List<AppRole> findByExportFlagAndEnableFlagAndAdminFlag(boolean exportFlag,boolean enableFlag,boolean adminFlag);
	List<AppRole> findByExtensionRolesInAndEnableFlag(Collection<AppRole> extensionRoles, boolean enableFlag);
}